<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../base.jsp"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<sys:genericTag4o id="columnsTag" methodName="getColumnList" className="com.tmpt.controller.taglib.TemplateHistoryTag">
	<sys:columnTag columnName="keyRandom" columnValue="${paramValues._keyRandom[0]}"/>
	<sys:columnTag columnName="_ishistory" columnValue="true"/>
</sys:genericTag4o>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>客户查询</title>    
<link href="../css/main.css" rel="stylesheet" type="text/css" >

<link rel="stylesheet" type="text/css" href="../../js/jquery/easyui1.5/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="../../js/jquery/easyui1.5/themes/icon.css">
<script type="text/javascript" src="../../js/jquery-1.8.0.min.js"></script>
<script src="../../js/jquery/easyui1.5/jquery.easyui.min.js"></script>
<script src="../../js/jquery/easyui1.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../js/jquery.select.js"></script>

<script type="text/javascript">
//定义全局变量记录分页信息  
var paramData = {  
 page:1,  
 rows:60,
 sortOrder:'desc', 
 sortColumn:'hid'
};  
var msgOut={};

$(function(){
	
	$('#list').datagrid({
        nowrap:true,
        autoRowHeight:false,
        fit:true,
        columns:[${columnsTag.columns}],
		frozenColumns:[${columnsTag.frozenColumns}],
        rownumbers:true,
        showFooter:true,
        pagination:true,
        onLoadSuccess:function(){ 
	    	$('#list').datagrid('loaded'); 
		}
	});
	
	var pager=$('#list').datagrid('getPager');
	$(pager).pagination({
		pageSize:paramData.rows,
		pageList:[60,80,100,200],
		beforePageText: '第',//页数文本框前显示的汉字   
        afterPageText: '页    共 {pages} 页',   
        displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录',
        onSelectPage:function(pageNumber,pageSize){
	    	paramData.page = pageNumber;
	    	paramData.rows = pageSize; 
	    	reLoadData(); 
        }
	});

	//查询行ID 和 是否history查询
	paramData._historyId=${paramValues.id[0]};
	//打开等待div
	$('#list').datagrid('loading');
	//execute ajax query
	$.ajax({
		type:"POST",
		url:"templateAjax_queryListBySearch.action?_keyRandom=${paramValues._keyRandom[0]}",
		dataType:"json",
		data:paramData,
		success:function(msg){
			if(JSON.stringify(msg).indexOf('error:')==0){
            	window.parent.error(JSON.stringify(msg));
			}else{
				$('#list').datagrid('loadData',msg);
			} 
		},
		error:function(er){
            window.parent.error(er);
	        $('#list').datagrid('loaded');
		}
	});
});


</script>
<style type="text/css">
	.center{padding: 3px;}
</style>

</head>

<body class="easyui-layout" style="margin: 2px;" >
	<div region="center" id="g" class="center" >
        <table id="list" class="datagrid_table" width="100%" ></table>
	</div>
</body>
</html>




